%%% -*- mode: erlang -*-
-ifndef(rtps_qos_hrl).
-define(rtps_qos_hrl, true).

-define(LENGTH_UNLIMITED, -1).

%% 2.2.3 DDS Supported QoS

-record(deadline_qos,            {period :: rtps:duration()}).
-record(destination_order_qos,   {kind :: by_reception_timestamp_destinationorder_qos |
					  by_source_timestamp_destinationorder_qos}).
-record(durability_qos,          {kind :: volatile_durability_qos |
					  transient_local_durability_qos |
					  transient_durability_qos |
					  persistent_durability_qos}).
-record(durability_service_qos,  {service_cleanup_delay :: rtps:duration(),
				  history_kind :: keep_last_history_qos |
						  keep_all_history_qos,
				  history_depth :: integer() | length_unlimited,
				  max_samples :: integer(),
				  max_instances :: integer(),
				  max_samples_per_instance :: integer()}).
-record(entity_factory_qos,      {autoenable_created_entities :: boolean()}).
-record(group_data_qos,          {value :: binary()}).
-record(history_qos,             {kind :: keep_last_history_qos |
					  keep_all_history_qos,
				  depth :: integer() | length_unlimited}).
-record(latency_budget_qos,      {duration :: rtps:duration()}).
-record(lifespan_qos,            {duration :: rtps:duration()}).
-record(liveliness_qos,          {kind :: automatic_liveliness_qos |
					  manual_by_participant_liveliness_qos |
					  manual_by_topic_liveliness_qos,
				  lease_duration :: rtps:duration()}).
-record(ownership_qos,           {kind :: shared_ownership_qos |
					  exclusive_ownership_qos}).
-record(ownership_strength_qos,  {value :: integer()}).
-record(partition_qos,           {name :: [list()]}).
-record(presentation_qos,        {access_scope :: instance_presentation_qos |
						  topic_presentation_qos |
						  group_presentation_qos,
				  coherent_access :: boolean(),
				  ordered_access :: boolean()}).
-record(readerdatalifecycle_qos, {autopurge_nowriter_samples_delay :: rtps:duration(),
				  autopurge_disposed_samples_delay  :: rtps:duration()}).
-record(reliability_qos,         {kind :: best_effort_reliability_qos |
					  reliable_reliability_qos,
				  max_blocking_time :: rtps:duration()}).
-record(resource_limits_qos,     {max_samples :: integer() | length_unlimited,
				  max_instances :: integer() | length_unlimited,
				  max_samples_per_instance :: integer() | length_unlimited}).
-record(time_based_filter_qos,   {minimum_separation :: rtps:duration()}).
-record(topic_data_qos,          {value :: binary()}).
-record(transport_priority_qos,  {value :: integer()}).
-record(user_data_qos,           {value :: binary()}).
-record(writerdatalifecycle_qos, {autodispose_unregistered_instances :: boolean()}).

-define(DEADLINE_QOS_ID,             4).
-define(DESTINATION_ORDER_QOS_ID,   12).
-define(DURABILITY_QOS_ID,           2).
-define(DURABILITY_SERVICE_QOS_ID,  22).
-define(ENTITY_FACTORY_QOS_ID,      15).
-define(GROUP_DATA_QOS_ID,          19).
-define(HISTORY_QOS_ID,             13).
-define(LATENCY_BUDGET_QOS_ID,       5).
-define(LIFESPAN_QOS_ID,            21).
-define(LIVELINESS_QOS_ID,           8).
-define(OWNERSHIP_QOS_ID,            6).
-define(OWNERSHIP_STRENGTH_QOS_ID,   7).
-define(PARTITION_QOS_ID,           10).
-define(PRESENTATION_QOS_ID,         3).
-define(READERDATALIFECYCLE_QOS_ID, 17).
-define(RELIABILITY_QOS_ID,         11).
-define(RESOURCE_LIMITS_QOS_ID,     14).
-define(TIME_BASED_FILTER_QOS_ID,    9).
-define(TOPIC_DATA_QOS_ID,          18).
-define(TRANSPORT_PRIORITY_QOS_ID,  20).
-define(USER_DATA_QOS_ID,            1).
-define(WRITERDATALIFECYCLE_QOS_ID, 16).

-define(DESTINATION_ORDER_QOS_KIND,
	[by_reception_timestamp_destinationorder_qos,
	 by_source_timestamp_destinationorder_qos]).
-define(DURABILITY_QOS_KIND,
	[volatile_durability_qos,
	 transient_local_durability_qos,
	 transient_durability_qos,
	 persistent_durability_qos]).
-define(HISTORY_QOS_KIND,
	[keep_last_history_qos,
	 keep_all_history_qos]).
-define(LIVELINESS_QOS_KIND,
	[automatic_liveliness_qos,
	 manual_by_participant_liveliness_qos,
	 manual_by_topic_liveliness_qos]).
-define(OWNERSHIP_QOS_KIND,
	[shared_ownership_qos,
	 exclusive_ownership_qos]).
-define(PRESENTATION_QOS_ACCESS_SCOPE,
	[instance_presentation_qos,
	 topic_presentation_qos,
	 group_presentation_qos]).
-define(RELIABILITY_QOS_KIND,
	[best_effort_reliability_qos,
	 reliable_reliability_qos]).

-define(qos_policys,
	[{user_data_qos,           ?USER_DATA_QOS_ID,           "UserData"},
	 {durability_qos,          ?DURABILITY_QOS_ID,          "Durability"},
	 {presentation_qos,        ?PRESENTATION_QOS_ID,        "Presentation"},
	 {deadline_qos,            ?DEADLINE_QOS_ID,            "Deadline"},
	 {latency_budget_qos,      ?LATENCY_BUDGET_QOS_ID,      "LatencyBudget"},
	 {ownership_qos,           ?OWNERSHIP_QOS_ID,           "Ownership"},
	 {ownership_strength_qos,  ?OWNERSHIP_STRENGTH_QOS_ID,  "OwnershipStrength"},
	 {liveliness_qos,          ?LIVELINESS_QOS_ID,          "Liveliness"},
	 {time_based_filter_qos,   ?TIME_BASED_FILTER_QOS_ID,   "TimeBasedFilter"},
	 {partition_qos,           ?PARTITION_QOS_ID,           "Partition"},
	 {reliability_qos,         ?RELIABILITY_QOS_ID,         "Reliability"},
	 {destination_order_qos,   ?DESTINATION_ORDER_QOS_ID,   "DestinationOrder"},
	 {history_qos,             ?HISTORY_QOS_ID,             "History"},
	 {resource_limits_qos,     ?RESOURCE_LIMITS_QOS_ID,     "ResourceLimits"},
	 {entity_factory_qos,      ?ENTITY_FACTORY_QOS_ID,      "EntityFactory"},
	 {writerdatalifecycle_qos, ?WRITERDATALIFECYCLE_QOS_ID, "WriterDataLifecycle"},
	 {readerdatalifecycle_qos, ?READERDATALIFECYCLE_QOS_ID, "ReaderDataLifecycle"},
	 {topic_data_qos,          ?TOPIC_DATA_QOS_ID,          "TopicData"},
	 {group_data_qos,          ?GROUP_DATA_QOS_ID,          "Group_Data"},
	 {transport_priority_qos,  ?TRANSPORT_PRIORITY_QOS_ID,  "TransportPriority"},
	 {lifespan_qos,            ?LIFESPAN_QOS_ID,            "Lifespan"},
	 {durability_service_qos,  ?DURABILITY_SERVICE_QOS_ID,  "DurabilityService"}]).

-endif.
